package cn.kdyzm.twofa.controller.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Objects;

/**
 * @author kdyzm
 * @date 2025/6/13
 */
@Controller
@RequestMapping
@Slf4j
public class IndexController {

    @GetMapping("/")
    public String hello(Model model, @CookieValue(value = "userId", required = false) Long userId) {
        if (Objects.isNull(userId)) {
            return "lyear_pages_login_1";
        }
        return "index";
    }
}
